package aufgabe3;

/**
 * @author Johannes Riedmann
 * @author David Medenjak
 * @author Lukas Koell
 */
public class EquilateralTriangle extends RegularPolygon{

    /**
     * Constructor
     * @param length length of edges.
     */
  public EquilateralTriangle(float length) {
    super(length);
  }

    /**
     * @return number of edges == 3
     */
    public int edges(){
        return 3;
    }
    
    /**
     * @return area of equilateral triangle > 0.00
     */
    public double area(){
        return length*length*Math.sqrt(3)/4;
    }
    
    /**
     * @return perimeter of equilateral triangle > 0.00
     */
    public double perimeter(){
        return length * 3;
    }
}
